package com.cy.pj.students.dao;

import com.cy.pj.students.pojo.Students;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentsDao {

    @Select("select * from stu")
    List<Students> findStudents();

    @Insert("insert into stu values(null, #{name}, #{duty}, now())")
    int doSaveStudents(Students students);

    @Select("select * from stu where id = #{id}")
    Students doFindById(Integer id);

    @Update("update stu set name = #{name}, duty = #{duty}, createdTime = now() where id = #{id}")
    int doUpdateStudents(Students students);

    @Delete("delete from stu where id = #{id}")
    int doDeleteById(Integer id);
}
